import { Rule } from "./types";

export const Flake8ComprehensionsRuleList: Rule[] = [
    {
        code: "C400",
        name: "unnecessary-generator-list",
        descEn: "Unnecessary generator (rewrite as a list comprehension)",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C401",
        name: "unnecessary-generator-set",
        descEn: "Unnecessary generator (rewrite as a set comprehension)",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C402",
        name: "unnecessary-generator-dict",
        descEn: "Unnecessary generator (rewrite as a dict comprehension)",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C403",
        name: "unnecessary-list-comprehension-set",
        descEn: "Unnecessary list comprehension (rewrite as a set comprehension)",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C404",
        name: "unnecessary-list-comprehension-dict",
        descEn: "Unnecessary list comprehension (rewrite as a dict comprehension)",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C405",
        name: "unnecessary-literal-set",
        descEn: "Unnecessary {obj_type} literal (rewrite as a set literal)",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C406",
        name: "unnecessary-literal-dict",
        descEn: "Unnecessary {obj_type} literal (rewrite as a dict literal)",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C408",
        name: "unnecessary-collection-call",
        descEn: "Unnecessary {obj_type} call (rewrite as a literal)",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C409",
        name: "unnecessary-literal-within-tuple-call",
        descEn: "Unnecessary {literal} literal passed to tuple() (rewrite as a tuple literal)",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C410",
        name: "unnecessary-literal-within-list-call",
        descEn: "Unnecessary {literal} literal passed to list() (remove the outer call to list())",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C411",
        name: "unnecessary-list-call",
        descEn: "Unnecessary list call (remove the outer call to list())",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C413",
        name: "unnecessary-call-around-sorted",
        descEn: "Unnecessary {func} call around sorted()",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C414",
        name: "unnecessary-double-cast-or-process",
        descEn: "Unnecessary {inner} call within {outer}()",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C415",
        name: "unnecessary-subscript-reversal",
        descEn: "Unnecessary subscript reversal of iterable within {func}()",
        descCn: "",
        autoFix: false,
    },
    {
        code: "C416",
        name: "unnecessary-comprehension",
        descEn: "Unnecessary {obj_type} comprehension (rewrite using {obj_type}())",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C417",
        name: "unnecessary-map",
        descEn: "Unnecessary map usage (rewrite using a generator expression)",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C418",
        name: "unnecessary-literal-within-dict-call",
        descEn: "Unnecessary dict {kind} passed to dict() (remove the outer call to dict())",
        descCn: "",
        autoFix: true,
    },
    {
        code: "C419",
        name: "unnecessary-comprehension-any-all",
        descEn: "Unnecessary list comprehension.",
        descCn: "",
        autoFix: true,
    },
];